package com.aaa.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @TableName menu
 */
public class Menu implements Serializable {
    /**
     * 菜单id
     */
    private Integer mid;

    /**
     * 菜单名
     */
    private String mname;

    /**
     * 菜单跳转页面
     */
    private String murl;

    /**
     * 父id
     */
    private Integer mpid;

    /**
     * 图标
     */
    private String icon;

    private static final long serialVersionUID = 1L;
    //当前菜单下的子菜单
    private List<Menu> children=new ArrayList<Menu>();

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    /**
     * 菜单id
     */
    public Integer getMid() {
        return mid;
    }

    /**
     * 菜单id
     */
    public void setMid(Integer mid) {
        this.mid = mid;
    }

    /**
     * 菜单名
     */
    public String getMname() {
        return mname;
    }

    /**
     * 菜单名
     */
    public void setMname(String mname) {
        this.mname = mname;
    }

    /**
     * 菜单跳转页面
     */
    public String getMurl() {
        return murl;
    }

    /**
     * 菜单跳转页面
     */
    public void setMurl(String murl) {
        this.murl = murl;
    }

    /**
     * 父id
     */
    public Integer getMpid() {
        return mpid;
    }

    /**
     * 父id
     */
    public void setMpid(Integer mpid) {
        this.mpid = mpid;
    }

    /**
     * 图标
     */
    public String getIcon() {
        return icon;
    }

    /**
     * 图标
     */
    public void setIcon(String icon) {
        this.icon = icon;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Menu other = (Menu) that;
        return (this.getMid() == null ? other.getMid() == null : this.getMid().equals(other.getMid()))
            && (this.getMname() == null ? other.getMname() == null : this.getMname().equals(other.getMname()))
            && (this.getMurl() == null ? other.getMurl() == null : this.getMurl().equals(other.getMurl()))
            && (this.getMpid() == null ? other.getMpid() == null : this.getMpid().equals(other.getMpid()))
            && (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMid() == null) ? 0 : getMid().hashCode());
        result = prime * result + ((getMname() == null) ? 0 : getMname().hashCode());
        result = prime * result + ((getMurl() == null) ? 0 : getMurl().hashCode());
        result = prime * result + ((getMpid() == null) ? 0 : getMpid().hashCode());
        result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", mid=").append(mid);
        sb.append(", mname=").append(mname);
        sb.append(", murl=").append(murl);
        sb.append(", mpid=").append(mpid);
        sb.append(", icon=").append(icon);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}